package com.lei.chinese_herbal_medicine.Service.Impl;

import com.lei.chinese_herbal_medicine.Entity.Token;
import com.lei.chinese_herbal_medicine.Mapper.TokenMapper;
import com.lei.chinese_herbal_medicine.Service.TokenService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service
public class TokenServiceImpl implements TokenService {
    @Resource
    private TokenMapper tokenMapper;

    @Override
    public boolean addToken(Token tokenObj) {
        return tokenMapper.insertSelective(tokenObj)==1;
    }

    @Override
    public Token getToken(Token token) {
        return tokenMapper.selectByPrimaryKey(token.getId());
    }

    @Override
    public boolean updateToken(Token token) {
        return tokenMapper.updateByPrimaryKeySelective(token)==1;
    }
}
